#ifndef __COMMONAPI_H__
#define __COMMONAPI_H__
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>

#include "driver/i2c.h"
#include "sdkconfig.h"

#define I2C_MASTER_SCL_IO 18				/*!< gpio number for I2C master clock */
#define I2C_MASTER_SDA_IO 14				/*!< gpio number for I2C master data  */
#define I2C_MASTER_NUM 1					/*!< I2C port number for master dev */
#define I2C_MASTER_FREQ_HZ 100000			/*!< I2C master clock frequency */
#define I2C_MASTER_TX_BUF_DISABLE 0			/*!< I2C master doesn't need buffer */
#define I2C_MASTER_RX_BUF_DISABLE 0			/*!< I2C master doesn't need buffer */

void printhex(uint8_t *data, uint16_t len);
bool parity_verify(uint8_t *data, uint16_t len);
esp_err_t i2c_master_init(void);
#endif //__COMMONAPI_H__